Skip to content

Extend check-env-docs to catch missing sidebar and catalog entries - #1024

Open
sergiopaniego wants to merge 1 commit into
huggingface:mainfrom
sergiopaniego:feature/sync-env-docs-catalog-check
Open

Extend check-env-docs to catch missing sidebar and catalog entries#1024
sergiopaniego wants to merge 1 commit into
huggingface:mainfrom
sergiopaniego:feature/sync-env-docs-catalog-check

Conversation

@sergiopaniego

@sergiopaniego sergiopaniego commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

check-env-docs only validates the per-env doc stubs. The docs sidebar (_toctree.yml) and the HTML catalog (environments.md) are maintained by hand, so forgetting them passes CI silently: qed_math has been missing its catalog card on main, and #1003 repeated the same pattern with latex_ocr. This PR extends sync_env_docs.py --check to fail when a stub is not listed in the sidebar or the catalog, and adds the missing QED Math card.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • New environment
  • Refactoring

Alignment Checklist

Before submitting, verify:

  • I have read .claude/docs/PRINCIPLES.md and this PR aligns with our principles
  • I have checked .claude/docs/INVARIANTS.md and no invariants are violated
  • I have run /pre-submit-pr (or bash .claude/hooks/lint.sh and tests) and addressed all issues

RFC Status

  • Not required (bug fix, docs, minor refactoring)
  • RFC exists: #___
  • RFC needed (will create before merge)

Test Plan

  • python scripts/sync_env_docs.py --check passes on this branch (the new QED Math card closes the only existing gap).
  • Negative test: removing any environments/<slug> link from environments.md (or its - local: entry from _toctree.yml) makes --check exit 1 with a message pointing at the missing entry and how to add it.
  • --fix / --dry-run still only write stub files. They now print a manual reminder for missing sidebar/catalog entries, including stubs --fix just created, since the card content needs a human-written description.
  • Orphaned stubs are excluded from the new checks: the fix there is deleting the stub, not listing it.
  • ruff check clean on the script.

Claude Code Review

Reviewed inline: the new find_unlisted() is read-only, check semantics are unchanged for existing failure modes, and CI wiring (.github/workflows/test.yml) needs no changes since it already runs --check.


Note

Low Risk
Documentation and CI validation only; no application runtime or security-sensitive code paths change.

Overview
sync_env_docs.py --check now fails CI when an environment doc stub exists but is missing from docs/source/_toctree.yml (sidebar) or docs/source/environments.md (HTML catalog). A new find_unlisted() step scans those files; orphaned stubs are skipped. --fix still only writes stub files but prints reminders to add sidebar/catalog entries manually, including slugs it just created.

environments.md gains a QED Math catalog card for qed_math, closing a gap that previously passed the old check.

Reviewed by Cursor Bugbot for commit 1fb49b8. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI review requested due to automatic review settings July 30, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants